import { Upload } from "@/api/interface/index";
import { CANROCNET } from "@/api/config/servicePort";
import http from "@/api";

/**
 * 文件上传
 *
 * @param params 图片文件
 * @returns 返回上传结果
 */
export const uploadApi = (params: FormData) => {
  return http.post<Upload.Result>(`${CANROCNET}/api/sys-file/upload`, params, { cancel: false });
};

/**
 * 模版文件上传
 *
 * @param params 模版文件
 * @returns 返回上传结果
 */
export const uploadTemplate = (params: FormData) => {
  return http.post<Upload.Result>(`${CANROCNET}/api/sys-file/upload/template`, params, { cancel: false });
};
